/*
 * @Author: your name
 * @Date: 2020-03-26 09:41:08
 * @LastEditTime: 2020-03-26 09:41:10
 * @LastEditors: Please set LastEditors
 * @Description: 小红帽
 */

// 获取图形验证码
export const getImg = "http://yzhbuy.youzihui.net//Public/verify?type=login&code_key="
// 登录
export const getLogin = "http://yzhbuy.youzihui.net/Public/login"
// 获取接单号
export const getAccountList = "http://yzhbuy.youzihui.net/Buyer/getAccountList"
// 加入任务队列
export const getAskforOrder = "http://yzhbuy.youzihui.net/Order/askforOrder"
// 系统分配任务
export const getDistribuleOrder = "http://yzhbuy.youzihui.net/Order/getDistribuleOrder"
// 确认接单
export const confirmReceipt = "http://yzhbuy.youzihui.net/Order/confirmReceipt"
// 取消任务
export const cancelOrder = "http://yzhbuy.youzihui.net/Order/cancelOrder"

// 获取key
export function getCodeKey() {
    for (var n = "", e = new Array(0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"), t = 0; t < 8; t++) {
        n += e[Math.floor(36 * Math.random())]
    }
    return n;
}

export function ajaxFun(url, param, fun) {
    window.api.ajax({
        url: url,
        method: param.type,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        dataType: 'json',
        returnAll: false,
        async: false,
        data: {
            values: param.data
        }
    }, fun)
}
